package com.zgjkhis.modules.his.rest;

import com.zgjkhis.modules.his.service.InfoTransmissionService;
import com.zgjkhis.modules.his.service.dto.DataPrescription;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName ApiController
 * @Deacription TODO
 * @Author yzq
 * @Date 2021/7/12 14:48
 * @Version 1.0
 **/
@Api(tags = "订单管理：处方传输")
@RestController
@RequestMapping("/his/pst")
public class HisTransmissionController {

    private final InfoTransmissionService infoTransmissionService;

    public HisTransmissionController(InfoTransmissionService infoTransmissionService) {
        this.infoTransmissionService = infoTransmissionService;
    }

    @PostMapping(value = "/getlist")
    @ApiOperation("获取中药处方列表")
    public ResponseEntity<Object> getlist(){
        List<DataPrescription> list=infoTransmissionService.queryList();
        return new ResponseEntity<>(list, HttpStatus.OK);
    }

    @PostMapping(value = "/getInfoByOrderNo")
    @ApiOperation("获取根据订单号获取中药处方列表")
    public ResponseEntity<Object> getInfoByOrderNo(String orderNo){
        List<DataPrescription> list=infoTransmissionService.queryInfoByOrderNo(orderNo);
        return new ResponseEntity<>(list, HttpStatus.OK);
    }


}
